﻿using UnityEngine;
using System.Collections;

public class SelectExpansionStageSceneManager : LTEventListenerC {
	public GameObject[] stagePanels;

	int selectedStageIndex = 0;

	// Use this for initialization
	void Start () {
		for(int i=selectedStageIndex+1; i<stagePanels.Length; i++)
		{
			stagePanels[i].SetActive(false);
		}

		ChangePanelStateToSelected();
	}

	void ChangePanelStateToSelected()
	{

		TweenRotation tweenRot = stagePanels[selectedStageIndex].gameObject.AddComponent<TweenRotation>();
		tweenRot.SetStartToCurrentValue();
		tweenRot.to = new Vector3(0f,42f,0f);
		tweenRot.duration = 1f;
		tweenRot.PlayForward();

		stagePanels[selectedStageIndex].gameObject.SetActive(true);

		foreach(Transform child in stagePanels[selectedStageIndex].transform)
		{
			child.gameObject.SetActive(true);
		}
	}
	
	public override void OnEvent (int eventID)
	{
		base.OnEvent (eventID);


	}
}
